<template>
    <div>
        <h1>班级列表</h1>
        <el-table :data="clazzList" style="width: 100%">
            <el-table-column prop="id" label="班级ID" width="180"></el-table-column>
            <el-table-column prop="name" label="班级名称"></el-table-column>
        </el-table>
    </div>
</template>

<script>
import service from '@/api';

export default {
    name: 'ViewClazzList',
    data() {
        return {
            clazzList: []
        }
    },
    async created() {
        this.clazzList = await service.get('/api/clazz', null, '获取班级列表');
    }
}
</script>

<style scoped>
h1 {
    margin-bottom: 20px;
}
</style>